#include<iostream>
using namespace std;
int Fun1(int n)
{
	int sum = 0;
	while (n) {
		sum += n % 10;
		n /= 10;
	}
	return sum;
}
int Fun2(int n)
{
	int sum = 0;
	while (n) {
		sum += n % 16;
		n /= 16;
	}
	return sum;
}
int Fun3(int n)
{
	int sum = 0;
	while (n) {
		sum += n % 12;
		n /= 12;
	}
	return sum;
}
int main()
{
	int n;
	while (cin >> n) {
		if (n == 0) {
			break;
		}
		int flag1 = Fun1(n);
		int flag2 = Fun2(n);
		if (flag1 == flag2) {
			int flag3 = Fun3(n);
			if (flag3 == flag2) {
				cout << n << " is a Sky Number." << endl;
			}
			else {
				cout << n << " is not a Sky Number." << endl;
			}
		}
		else {
			cout << n << " is not a Sky Number." << endl;
		}
	}
	return 0;
}